class Shape{
public:
    virtual float getArea()=0;

    virtual ~Shape(){}
};

//你的代码将被嵌在这里
#include <iostream>
#define PI 3.14

using namespace std;
class Rectangle :public Shape
{
private:
    float l,d;
public:
    Rectangle(float a,float b):l(a),d(b){}
    virtual float getArea();
    virtual ~Rectangle(){}
};
float Rectangle::getArea()
{
    return l*d;
}


class Square:public Rectangle
{
public:
    Square(float i):Rectangle(i,i){}
};



class Circle :public Shape
{
private:
    float r;
public:
    Circle(float a):r(a){}
    virtual float getArea();
    virtual ~Circle(){}
};
float Circle::getArea()
{
    return r*r*PI;
}


int main()
{  Shape *ps;
    ps=new Circle(5);
    cout<<"The area of the Circle is "<<ps->getArea()<<endl;
    delete ps;
    Rectangle *pr;
    pr=new Rectangle(5,6);
    cout<<"The area of the Rectagle is "<<pr->getArea()<<endl;
    delete pr;
    Square s(8);
    pr=&s;
    cout<<"The area of the Square is "<<pr->getArea()<<endl;
    delete pr;
    return 0;
}